var init;
var intetimes;
Page({
  data: {
    //小程序计时器
   
    millisecond: 0,
  },


  onShareAppMessage: function (res) {
    var that = this;
    var goods_id = 1;//获取产品id
    var goods_title = '测试标题';//获取产品标题
    var goods_img = 'http://101.132.97.213:9090/image/1233212212212/1575952652583827.jpg';//产品图片
    if (res.from === 'button') {
      // 来自页面内转发按钮
      return {
        title: goods_title,
        path: '/page/details?code=' + that.data.data,
        //imageUrl: goods_img //不设置则默认为当前页面的截图
      }
    }
  },

  //开始
  start: function () {
    clearInterval(intetimes);
    intetimes = setInterval(function () {
      wx.showToast({
        title: '扫描超时',
        icon: 'success',
        duration: 3000,
        success: function () {
          setTimeout(function () {
            //this.data.cameraListener.stop()
            clearInterval(intetimes);
            console.log(666)
            // wx.switchTab({
            //   url: '../index/index'
            // })
          }, 2000) //延迟时间 
        }
      })
    }, 3000);
  },
  //暂停
  stop: function () {
    this.timer()
    clearInterval(init);
  },
  //停止
  reset: function () {
    var that = this;
    clearInterval(intetimes);
  },
  //执行时间
  timer: function () {
    var that = this;
    console.log(that.data.millisecond)
    that.setData({
      millisecond: that.data.millisecond + 50
    })
  },

//----------------------------------------------
 //提示框
  tishi:function(){
    wx.showToast({
      title: "该功能暂无开放",
      icon: 'search',
      image:'../../assets/icons/wode1.png',
      type: 'success',
      duration: 2000
    })
  },


});
